<!DOCTYPE html>
<html lang="en">
<head>
<title><#:C('sitename')#>--会员中心</title>
<meta name="keywords" content="<#:C('keyword')#>" />
<meta name="description" content="<#:C('content')#>" />
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<include file="Pub:Css" />
<link rel="stylesheet"
	href="<#$Theme['P']['root']#>/matrix/css/uniform.css" />
<link rel="stylesheet"
	href="<#$Theme['P']['root']#>/matrix/css/select2.css" />
</head>
<body>
<include file="Pub:top" />
<include file="Pub:nav" />

<div id="content">
	<div id="content-header">
		<div id="breadcrumb">
			<a href="<#:U('user/index')#>" title="返回首页" class="tip-bottom">
				<i class="icon-home"></i>首页
			</a> 
			<a href="#" class="current">应用设置</a>
		</div>
		<h1>应用设置</h1>
	</div>
	<div class="container-fluid">
		<hr>
		<div class="row-fluid">
			<div class="span8">
				<div class="widget-box">
					<div class="widget-title">
					<span class="icon"> 
						<i class="icon-align-justify"></i>
					</span>
					<h5>编辑</h5>
				</div>
				<div class="widget-content nopadding">
				<form name='form' action="<#:U('index/User/doapp')#>" method="post" class="form-horizontal">
					<div class="control-group">
						<div class="span1"></div>
						<div class="alert alert-block span10 hide" id="msgbox">
							<h4 class="alert-heading">提示信息</h4>
							<div id="alertmsg"></div>
						</div>
					</div>
					<div class="control-group">
						<label class="control-label" style="padding-top:10px">认证模式:</label>
						<div class="controls">
							<volist name="authmode" id="vo"> 
								<label style="float:left; line-height:20px;padding-right:10px;">
									<input id="check_<#$vo.key#>" onclick="getcheck(this)" type="checkbox" value="<#$vo.key#>"name="authmode[]"<#:showauthcheck($vo['key'],$info['authmode'])#>/><#$vo.txt#>
								</label> 
							</volist>
						</div>
					</div>
					<!-- 手机认证 -->
					<div class="control-group" id="phoneauth">
						<label class="control-label">手机认证方式选择:</label>
						<div class="controls" >
							<label style="float:left;padding-right:10px;"> 		<input type="radio" value="0" name="smsstatus"<eq name="info['smsstatus']" value="0">checked</eq>>虚拟信息认证 
							</label> 
							<label> <input type="radio" value="1" name="smsstatus"<eq name="info['smsstatus']" value="1">checked</eq>>短信认证 
							</label> 
							<span class="help-block">请选择手机信息验证方式</span>
						</div>
						<label  class="control-label"> 企业签名:</label>
						<div class="controls">
							<input type="text" class="span11"placeholder="请输入企业签名 " name="companyname" id=" companyname"value="<#$info['companyname']#>" />
						</div>
						<label  class="control-label"> 短信认证内容模板:</label>
						<div class="controls">
							<input type="text" class="span11"placeholder="请输入企业签名 " name="authmsg" id=" authmsg"value="<#$info['authmsg']#>" />
							<span class="help-block">【*】代表认证码</span>
						</div>
					</div>
					<div class="control-group">
						<label class="control-label">微信号:</label>
						<div class="controls">
							<input type="text" class="span11"  placeholder="微信号" name="wx" id="wx" value="<#$info['wx']#>" /> 
							<span class="help-block">请输入您想让用户关注的微信名称</span>
						</div>
						<label class="control-label">微信关注链接:</label>
						<div class="controls">
							<input type="text" class="span11"  placeholder="微信关注链接" name="wxurl" id="wx" value="<#$info['wxurl']#>" /> 
							<span class="help-block">请输入您想让用户关注的微信号链接；例如：http://www.baidu.com；注意：微信链接必须以<span style="color:#c40000">" http:// "</span>开头</span>
						</div>
					</div>
				<!-- <div class="control-group" id="wxauth">
					<label class="control-label">微信认证密码 :</label>
					<div class="controls">
						<input type="text" class="span11"placeholder="微信认证密码 " name="wxauthpwd" id="wxauthpwd"value="<#:echojsonkey(showauthdata('3',$info['authmode']),'pwd')#>" />
						<span class="help-block">输入微信认证上网的认证密码</span>
					</div>
				</div> -->
					<div class="control-group">
						<label class="control-label">上网时段控制:</label>
						<div class="controls">
							<select name="sh" id="sh" class="span3">
								<for start="0" end="24">
									<option value="<#$i#>"<eq name="info['sh']" value="$i">selected</eq>><#$i#>:00点</option>
								</for>
							</select> 
							<label class="span1" style="text-align:center;margin-bottom:0px;line-height:30px">到</label> 
							<select name="eh" id="eh" class="span3">
								<for start="1" end="24">
									<option value="<#$i#>"<eq name="info['eh']" value="$i">selected</eq>><#$i#>:00点</option>
								</for>
							</select>
							<div class="span5"></div>
							<span class="span12 help-block" style="margin-left:0px;line-height:30px">允许用户上网的时间范围。注:比如 7:00~20:00点</span>
						</div>
					</div>
					<div class="control-group">
						<label class="control-label" style="padding-top:10px">上网限制:</label>
						<div class="controls">
							<label style="float:left;padding-right:10px"> <input type="radio" value="1" name="countflag"<eq name="info['countflag']" value="1">checked</eq>>启用 
							</label> 
							<label style="float:left;padding-right:10px"> <input type="radio" value="0" name="countflag"<eq name="info['countflag']" value="0">checked</eq>>停用 
							</label> 
							<span class="help-block">上网限制,可有效防止员工长时间占用无线网络</span>
						</div>
					</div>
					<div class="control-group">
						<label class="control-label">上网允许认证次数:</label>
						<div class="controls">
							<input type="text" class="span11" placeholder="请输入认证次数" name="countmax" id="countmax" value="<#$info['countmax']#>" /> 
							<span class="help-block">
						本日允许使用wifi的次数（在启用上网限制功能后有效）
							</span>
						</div>
					</div>
					<div class="control-group">
						<label class="control-label">上网时间限制:</label>
						<div class="controls">
						<input type="text" class="span11"placeholder="请输入时间(单位:分钟)" name="timelimit" id="timelimit" value="<#$info['timelimit']#>" /> 
						<span class="help-block">允许用户上网的时间(单位:分钟)。<span style="color:#000000">注:不限制时间请填:0；上网时间最短设置为10分钟</span></span>
						<span id="spanmsg" style="color:#c40000;"></span>
					</div>
				</div>
					<div class="control-group">
						<label class="control-label" style="padding-top:10px">认证后行为:</label>
						<div class="controls">
							<label style="float:left;padding-right:10px;"> 
							<input type="radio" value="1" name="authaction"<eq name="info['authaction']" value="1">checked</eq>>跳转指定网页 
							</label> 
							<label style="float:left;padding-right:10px;"> 
								<input type="radio" value="0" name="authaction"<eq name="info['authaction']" value="0">checked</eq>>不跳转
							</label> 
							<label style="float:left;padding-right:10px;"> 
								<input type="radio" value="2" name="authaction"<eq name="info['authaction']" value="2">checked</eq>>跳转请求网页 
							</label> 
							<label style="float:left;padding-right:10px;"> 
								<input type="radio" value="3" name="authaction"<eq name="info['authaction']" value="3">checked</eq>>跳转到微官网 
							</label> 
							<span class="help-block">用户通过认证后引导用户行为选择。</span>
						</div>
					</div>
					<div class="control-group">
						<label class="control-label">指定跳转URL:</label>
						<div class="controls">
							<input type="text" class="span11" placeholder="跳转网页地址 " name="jumpurl" id="jumpurl" value="<#$info['jumpurl']#>" />
						</div>
					</div>
					<div class="control-group" id="notice">
						<label class="control-label">公告:</label>
						<div class="controls">
							<input type="text" class="span11" placeholder="公告" name="notice" id="bgnnotice" value="<#$info['notice']#>" />
							<span class="help-block">在认证页滚动显示</span>
						</div>
					</div>
					<div class="form-actions">
						<input type="submit" class="btn btn-success" name="sub" value="保存" />
					</div>
				</form>
				</div>
			</div>
		</div>
	</div>
</div>
</div>
<include file="Pub:foot" />
<script src="<#$Theme['P']['root']#>/matrix/js/jquery.min.js"></script>
<script src="<#$Theme['P']['root']#>/matrix/js/jquery.ui.custom.js"></script>
<script src="<#$Theme['P']['root']#>/matrix/js/bootstrap.min.js"></script>
<script src="<#$Theme['P']['root']#>/matrix/js/matrix.js"></script>
<script src="<#$Theme['P']['root']#>/matrix/js/jquery.uniform.js"></script>
<script src="<#$Theme['P']['root']#>/matrix/js/select2.min.js"></script>
<script src="<#$Theme['P']['root']#>/matrix/js/common.js"></script>
<script>
	function getcheck(obj){
		//alert(key);
		var x=obj.value;
		if(x == 3 || x == 4){
		var checkedChoose = obj.parentNode.className;
		if(x == 3 && checkedChoose == ''){
			var checkedBox4 = document.getElementById("check_4");
			checkedBox4.parentNode.className = '';
			checkedBox4.checked = false;
			obj.checked = true;
		}else if(x == 4 && checkedChoose == ''){
			var checkedBox3 = document.getElementById("check_3");
			checkedBox3.parentNode.className = '';
			checkedBox3.checked = false;
			obj.checked = true;
		}
		if(checkedChoose == ''){
			checkedChoose = 'checked';
		}else{
			checkedChoose = '';
		}
		}
	}


$(document).ready(function(){
	$('input[type=checkbox],input[type=radio],input[type=file]').uniform();
	
	$('select').select2();

	$("input[name='authmode[]']").each(function(){
		if($(this).attr('checked')&&$(this).val()==1){
			$('#phoneauth').show();
			$('#wxacc').show();
		}
		$(this).bind('click',function(){
				
				if($(this).attr('checked')&&$(this).val()==1){
						$('#phoneauth').show();
						$('#wxacc').show();
				}else if(!$(this).attr('checked')&&$(this).val()==1){
						$('#phoneauth').hide();
						$('#wxacc').hide();
				}
		});

		if($(this).attr('checked')&&$(this).val()==3){
			$('#wxauth').show();
			$('#wxacc').show();
		}
		$(this).bind('click',function(){
				
				if($(this).attr('checked')&&$(this).val()==3){
						$('#wxauth').show();
						$('#wxacc').show();
				}else if(!$(this).attr('checked')&&$(this).val()==3){
						$('#wxauth').hide();
						$('#wxacc').hide();
				}
		});

	});

	$("input[name='sub']").bind('click',function(){
		var rs=true;
		$("input[name='authmode[]']").each(function(){
			// 手机认证
			if($(this).attr('checked')&&$(this).val()==1){
				var code=$('#code').val();
				if (code==""||code==0){
					AlertTips("请输入手机认证位数",2000);
					rs= false;
				}
			}
			// 微信认证
			if($(this).attr('checked')&&$(this).val()==3){
				
					 var v=$('#wxauthpwd').val();
						
					 if (v == "") {
						
						 AlertTips("请输入微信认证密码",2000);
					        rs= false;
					 }
					 if(!isaccount(v)){
						
						 AlertTips("请输入微信认证密码",2000);
					        rs= false;
					 }
					 var wx=$('#wx').val();
						
					 if (wx == "") {
						
						 AlertTips("请输入微信账号",2000);
					        rs= false;
					 }
				
				}
			// 微信关注认证 
			if($(this).attr('checked')&&$(this).val()==4){
				 var wx=$('#wx').val();
					
				 if (wx == "") {
					
					 AlertTips("请输入微信账号",2000);
				        rs= false;
				 }
			
			}


		});
			
		return rs;
	});
	$('input[name="timelimit"]').blur(function(event) {
		// 上网时间限制
		var timelimit=$(this).val();
			timelimit=timelimit*1;
			$('#spanmsg').html('');
		if(1<=timelimit && timelimit<10){
			$('#spanmsg').html('上网时间限制至少设置10分钟');
		}else{
			$('#spanmsg').html('');
		}
	});
	
});
</script>
</body>
</html>